<?php
namespace app\index\controller;
use think\Request;  
use think\controller\Rest; 
class Major extends Rest{
    public function readAll(){
        $start=input('param.start')!=NULL?input('param.start'):0;
        $count=input('param.count')!=NULL?input('param.count'):10;
        $model = model('major');   
        $data=$model->limit($start,$count)->select();
        return json($data);  
    }
    public function read($id){  
        $model = model('major');   
        $data=$model->where('id', $id)->find(); 
        return json($data);  
    }
}